< previous page page_517 next page >

Page 517
and create subroutines AddCurvePoint and AddPathPoint to allow your program to define the curve and path.
The Extrusion3d class can use Polyline3d objects to display the surface. The public Extrude method uses the base curve and generator to create these Polyline3d objects.
e10a6a0a59f035e870d90cca05b85fce.gif
Option Explicit

Private NumCurvePts As Integer
Private NumPathPts As Integer

Private CurvePoints() As Point3D
Private PathPoints() As Point3D

Private ThePolyline As Polyline3d

' Add a point to the base curve.
Public Sub AddCurvePoint(ByVal X As Single, _
    ByVal Y As Single, ByVal Z As Single)

    NumCurvePts = NumCurvePts + 1
    ReDim Preserve CurvePoints(1 To NumCurvePts)

    With CurvePoints(NumCurvePts)
        .coord(1) = X
        .coord(2) = Y
        .coord(3) = Z
        .coord(4) = 1
    End With
End Sub

' Add a point to the generating path.
Public Sub AddPathPoint(ByVal X As Single, _
    ByVal Y As Single, ByVal Z As Single)

    NumPathPts = NumPathPts + 1
    ReDim Preserve PathPoints(1 To NumPathPts)

    With PathPoints(NumPathPts)
        .coord(1) = X
        .coord(2) = Y
        .coord(3) = Z
        .coord(4) = 1
    End With
End Sub

' Create the display polylines.
Public Sub Extrude()
Dim i As Integer
Dim j As Integer

 
< previous page page_517 next page >